package pool.api;

import org.junit.Test;

import java.util.concurrent.*;

/**
 * Created mangcao with 2020/1/11 9:58
 * Description:
 */

public class ThreadPoolExecutorde {


    public static void main(String[] args) throws Exception{


        final ExecutorService pool = new ThreadPoolExecutor(
                1,
                2,
                2,
                TimeUnit.HOURS,
                new LinkedBlockingDeque<>(1)
//                null,
//                null
        );


        Runnable runnable = () -> {
            try {
                Thread.sleep(500000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        };

        Callable callable = () -> null;

        Future future;

        for (int i = 0; i < 10; i++) {
            pool.submit(callable);
        }
    }


    @Test
    public void Test(){
        ExecutorService executorService = Executors.newFixedThreadPool(2);


        executorService.submit(() -> {});

    }


}
